package kr.co.insoft.core.service.orchestration;

import kr.co.insoft.core.model.orchestration.CompositeEntityModel;
import kr.co.insoft.core.model.orchestration.CompositeStackEntityModel;
import kr.co.insoft.core.model.orchestration.OrchestrationResultModel;
import kr.co.insoft.core.model.orchestration.ProjectEntityModel;
import kr.co.insoft.core.model.orchestration.ServiceEntityModel;
import kr.co.insoft.framework.exceptions.ServiceException;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.transaction.annotation.Transactional;

public interface OrchestrationService {

	public ProjectEntityModel getProject(String targetid)
			throws ServiceException;

	public ServiceEntityModel getService(String targetid)
			throws ServiceException;

	public CompositeEntityModel getComposite(String targetid)
			throws ServiceException;

	public ServiceEntityModel createServiceForm(String projectid)
			throws ServiceException;

	public CompositeEntityModel createCompositeForm(String serviceid)
			throws ServiceException;

	public CompositeStackEntityModel createStackForm(String compositeid)
			throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public OrchestrationResultModel createProject(
			ProjectEntityModel projectEntityModel) throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public OrchestrationResultModel createService(
			ServiceEntityModel serviceEntityModel) throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public OrchestrationResultModel createComposite(
			CompositeEntityModel compositeEntityModel) throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public void removeProject(String targetid) throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public void removeService(String targetid) throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public void removeComposite(String targetid) throws ServiceException;

	@Transactional(rollbackFor = ServiceException.class)
	@CacheEvict("OrchestrationTree")
	public OrchestrationResultModel createStack(
			CompositeStackEntityModel compositeStackEntityModel)
			throws ServiceException;

}
